/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package sunny;

import com.util.Log;
import crawler.PassionScout;
import java.util.Vector;

/**
 *
 * @author SDS
 */
public class Sunny {

    public Vector<String[]> run() {
        
        PassionScout ps = new PassionScout();

        Vector<String[]> result = new Vector<String[]> ();

        for( int inx = 1; inx < 2; inx++ ) {
            Log.println( "페이지 : " + inx );
            Vector<String[]> data = ps.getData( ps.URL_WEAR, inx );

            if( data.isEmpty() ) {
                Log.println( "마지막입니다.");
                break;
            }
            
            for( int jnx = 0, jnxCnt = data.size(); jnx < jnxCnt; jnx++ ) {
                result.add( data.get(jnx) );
            }

            //printData( data );

        }


        return result;

    }

    private void printData( Vector<String[]> data ) {

        for( int inx = 0, inxCnt = data.size(); inx < inxCnt; inx++ ) {

            String[] cols = data.get( inx );

            for( int jnx = 0, jnxCnt = cols.length; jnx < jnxCnt; jnx++ ) {
                Log.print( cols[jnx] + "|\t" );
            }
            Log.println( "" );
        }
    }

}
